package StudyCode.summary.zipfile;

import java.io.IOException;
import java.io.RandomAccessFile;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class Reads4BytesFromRandomAccessFileToString {
	public static String read4Chars(RandomAccessFile raf)
			throws IOException {
		StringBuffer sbuf = new StringBuffer(4);
		for (int i = 0; i < 4; i++) {
			char ch = (char) raf.read();
			sbuf.append(ch);
		}
		return sbuf.toString();
	}
}
